1. Field of the Invention
The present invention relates to digital image processing, and more particularly to a method and apparatus for detection and correction of red-eye defects and/or other artifacts in an acquired digital image.
2. Description of the Related Art
Redeye is the appearance of an unnatural reddish coloration of the pupils of a person appearing in an image captured by a camera with flash illumination. Redeye is caused by light from the flash reflecting off blood vessels in the person's retina and returning to the camera.
A large number of image processing techniques have been proposed to detect and correct redeye in color images. In general, these techniques typically are semi-automatic or automatic. Semi-automatic redeye detection techniques rely on human input. For example, in some semi-automatic redeye reduction systems, a user must manually identify to the system the areas of an image containing redeye before the defects can be corrected.
Many automatic redeye reduction systems rely on a preliminary face detection step before redeye areas are detected. A common automatic approach involves detecting faces in an image and, subsequently, detecting eyes within each detected face. After the eyes are located, redeye is identified based on shape, coloration, and brightness of image areas corresponding to the detected eye locations. In general, face-detection-based automatic redeye reduction techniques have high computation and memory resource requirements. In addition, most of the face detection algorithms are only able to detect faces that are oriented in an upright frontal view. These approaches generally do not detect faces that are rotated in-plane or out-of-plane with respect to the image plane.
A redeye filter process is illustrated in FIG. 1(a). An input image is first analyzed by a speed optimized redeye detection stage 100 at a pixel level 103 and segmented into candidate redeye regions 104. A further series of falsing and verification filters 106 are then applied to the candidate regions and a set of confirmed redeye regions 108 is thus determined A correction filter (pixel modifier) 102 is next applied to the confirmed regions and a final image 112, corrected for redeye, is generated.
U.S. Pat. No. 6,407,777 to inventor DeLuca discloses in-camera detection and correction of redeye pixels in an acquired digital image, while US published patent application 2002/0176623 to inventor Steinberg discloses automated real-time detection and correction of redeye defects optimized for handheld devices (each of these is assigned to the same assignee as the present application, as are U.S. application Ser. Nos. 10/919,226, filed Aug. 16, 2004, 10/772,092, filed Feb. 4, 2004, 10/772,767, filed Feb. 4, 2004, and 10/635,918, filed Aug. 5, 2003). US published patent applications 2005/0047655 and 2005/0047656 to Luo et al disclose techniques for detecting and correcting redeye in a digital image and in embedded systems, respectively. The aforementioned patent and published and unpublished patent applications are all hereby incorporated by reference.
Within an image acquisition subsystem such as is embodied in typical digital cameras, a peak computing load and resource requirements occur around the time of image acquisition. Upon receiving an image acquisition request from the user the main embedded processing system refines the image focus and exposure to achieve an optimal main acquired image. This image, in turn, is off-loaded from the main optical sensor of the camera and subjected to further image processing to convert it from its raw format (e.g. Bayer) to a conventional color space such as RGB or YCC. Finally the acquired image is compressed prior to saving it on a removable storage medium such as a compact flash or multimedia card.
The time taken by the camera to recover from the acquisition of a first image and reinitialize itself to capture a second image is referred to as the “click-to-click” time. This parameter is used in the comparison and marketing of modern digital cameras. It is desired for manufacturers to minimize this “click-to-click” time. Thus, it is desired that any additional image processing, such as redeye filtering, which is to be added to the main image acquisition chain should be highly optimized for speed of execution in order to minimize its impact on the click-to-click time of the main system. Such a redeye filter typically compromises its overall performance in terms of accuracy of detection of redeye defects and quality of image correction.
An alternative would be to wait until after the main image has been acquired and perform the redeye filtering at a later time when the camera may execute the filter as a background process, or to perform the redeye filtering off-camera on a desktop PC or printer. There can be drawbacks to this alternative approach, though. First, images are displayed on the acquiring device, immediately after acquisition, with uncorrected redeye defects. Second, when images are accessed in playback mode, there is a further delay while images are post-processed before an image can be displayed. Both drawbacks would create a negative impression on end users.
Further, as most digital cameras store images using lossy compression techniques there can be additional disadvantages with respect to image quality as images are decompressed and recompressed in order to perform redeye detection and correction processes in playback or background modes. Such loss of image quality may not become apparent until later when a user wishes to print an image and it is too late to reverse the process.
If redeye processing is delayed until the images are loaded onto another device, such as a desktop PC or printer, there can be further disadvantages. First, meta-data relating to the acquiring device and its state at the time the image was acquired may not be available to the redeye filter process. Second, this post-processing device performs redeye filtering on the entire image; so that for an embedded device such as a printer that may be relatively constrained in terms of CPU cycles and processing resources for its primary post-processing activity, it would be desirable to optimize the performance of the full redeye filter. It is generally desired to optimize the detection of red-eye defects in digital images for embedded image acquisition and processing systems.